package org.yray.somehttp.js;

import net.sourceforge.htmlunit.corejs.javascript.engine.RhinoScriptEngineFactory;

import javax.script.ScriptEngine;
import javax.script.ScriptException;
import javax.script.SimpleScriptContext;
import java.io.FileNotFoundException;
import java.io.FileReader;

public class HtmlunitJsTest {
    public static void main(String[] args) throws FileNotFoundException, ScriptException {
        RhinoScriptEngineFactory rhinoScriptEngineFactory=new RhinoScriptEngineFactory();
        String fileName="D:\\git_wk\\utools\\ufiletools\\src\\main\\resources\\aliplayer-min.js";
        ScriptEngine en=rhinoScriptEngineFactory.getScriptEngine();
        Object o=en.eval(new FileReader(fileName),new SimpleScriptContext());
        System.out.println(o);


    }
}
